<?php

namespace common\models\user;

use common\models\Common;
use common\models\Status;
use common\services\auth\AuthApiAliyun;
use yii\base\Exception;

/**
 *
 *  * 用户实名审核
 * This is the model class for table "goods".
 *
 * @property int $id
 * @property string $name
 */
class UserReal extends Common
{
    public $endDate = '';

    public static function tableName()
    {
        return '{{%user_kyc}}';
    }

    //获取用户
    public function getUser()
    {
        return $this->hasOne(User::className(), ['id' => 'user_id']);
    }


    public function afterKYC($userId = 0, $parentId = 0) {

//        $user = User::getOneInfoById($userId, ['level_id', "parent_id", "id"]);
//        # 进行升级
//        if ($user['level_id'] == 1) {
//            $up['level_id'] = 2;
//        }

        $up['is_kyc'] = Status::COMMON_RADIO_YES;
        User::updateData($up, ['id' => $userId]);



    }

}
